Skip to content

Conversation

@Will-ShaoHua
Copy link
Contributor

@Will-ShaoHua Will-ShaoHua commented Apr 11, 2025

Description

the project: Project provided by AmazonQToolWindowFactory is shadowed by project: Project in RegionProfileListener.onProfileChanged(project: Project, profile: Profile), the consequence is only the project where profile change happens will get updated with the Chat UI (mynah-ui)

License

I confirm that my contribution is made under the terms of the Apache 2.0 license.

@Will-ShaoHua Will-ShaoHua changed the title Multi window fix(amazonq): fix users some ide window will be stuck at fetching profile... state in multi window use case Apr 11, 2025
@Will-ShaoHua Will-ShaoHua marked this pull request as ready for review April 15, 2025 18:29
@Will-ShaoHua Will-ShaoHua requested review from a team as code owners April 15, 2025 18:29
@Will-ShaoHua Will-ShaoHua changed the title fix(amazonq): fix users some ide window will be stuck at fetching profile... state in multi window use case fix(amazonq): fix Q panel will get stuck while signin if users have multiple window Apr 15, 2025
@Will-ShaoHua Will-ShaoHua marked this pull request as draft April 15, 2025 18:43
@Will-ShaoHua Will-ShaoHua self-assigned this Apr 15, 2025
@Will-ShaoHua Will-ShaoHua marked this pull request as ready for review April 15, 2025 18:59
project.messageBus.connect(toolWindow.disposable).subscribe(
QRegionProfileSelectedListener.TOPIC,
object : QRegionProfileSelectedListener {
override fun onProfileSelected(project: Project, profile: QRegionProfile?) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line project is shadowing outside AmazonQToolWindowFactory.project

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thus the following 2 lines also use the wrong project

AmazonQToolWindow.getInstance(project).disposeAndRecreate()
qPanel.setContent(AmazonQToolWindow.getInstance(project).component)

@Will-ShaoHua Will-ShaoHua requested a review from evanliu048 April 16, 2025 17:11
@Will-ShaoHua Will-ShaoHua merged commit 6947870 into aws:main Apr 16, 2025
13 of 14 checks passed
@Will-ShaoHua Will-ShaoHua deleted the multi-window branch April 16, 2025 17:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants